package com.project.common.fundamental.response;

import java.io.Serializable;
import java.util.Date;

public class Response implements Serializable {
    public static final int SUCCESS_CODE = 0;
    public static final int FAILED_CODE = 999999;
    private int code;
    private String message;
    private Date timestamp;

    public Response() {
    }

    protected Response(int code, String message) {
        this.code = code;
        this.message = message;
        this.timestamp = new Date();
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public boolean success() {
        return this.code == SUCCESS_CODE;
    }
}
